package link.anyauto.fsmgr.util;

import java.util.List;

/**
 * Created by Administrator on 2016/7/16.
 */
public class CompareUtil {

    public static boolean equals(Object o1, Object o2) {
        return o1 == null ? o2 == null : o1.equals(o2);
    }

    public static boolean equals(List<?> list1, List<?> list2) {
        if(list1 == null && list2 == null) {
            return true;
        } else if(list1 != null && list2 != null && list1.size() == list2.size()){
            boolean equals = true;
            for(int i=0; i<list1.size(); i++) {
                if(!equals(list1.get(i), list2.get(i))) {
                    equals = false;
                    break;
                }
            }
            return equals;
        }
        return false;
    }

}
